package xyz.codingli.servlet;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

/**
 * @author mizzle rain
 * @date 2021-01-12 23:24
 */
public class SetSessionServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        HttpSession session = req.getSession();
        session.setAttribute("name", "session_name");
        String id = session.getId();
        resp.getWriter().print(id);
    }
}
